/* GUI CONVERTED from ppptiq.p (converter v1.75) Sun Aug 13 13:47:54 2000 */
/* ppptiq.p - PART MASTER INQUIRY                                       */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert ppptiq.p (converter v1.00) Mon Mar 09 11:04:36 1998 */
/* web tag in ppptiq.p (converter v1.00) Mon Mar 09 11:04:26 1998 */
/*F0PN*/ /*K1KW*/ /*                                                    */
/*V8:ConvertMode=Report                                        */
/* REVISION: 6.0      LAST MODIFIED: 05/18/90   BY: PML                 */
/* REVISION: 7.3      LAST MODIFIED: 09/17/92   BY: pma *G068*          */
/* Revision: 7.3    Last edit: 11/19/92     By: jcd *G339* */
/* REVISION: 8.6E      LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E      LAST MODIFIED: 03/09/98   BY: *K1KW* Beena Mol    */
/* REVISION: 8.6E      LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan   */
/* REVISION: 8.6E      LAST MODIFIED: 06/03/98   BY: *K1RS* A.Shobha     */
/* REVISION: 9.1       LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1       LAST MODIFIED: 08/13/00   BY: *N0KQ* myb              */

/*K1KW*/ /* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K1KW*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE ppptiq_p_1 "Line!Rev"
/* MaxLen: Comment: */

&SCOPED-DEFINE ppptiq_p_2 "Group!Status"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable pl like pt_prod_line.
define variable part_group like pt_group.
define variable part like pt_part.
define variable desc1 like pt_desc1.

/*K1KW* /* DISPLAY TITLE */
 * {mfdtitle.i "b+ "} /*G068*/  */

part = global_part.
global_ref = "pt_group". /*setup for part_group lookup */

/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   part
   pt_desc1       no-label
   pl
   part_group
with frame a no-underline width 80 attr-space THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME

/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K1KW*/ {wbrp01.i}

repeat:

/*K1KW*/ if c-application-mode <> 'web' then
   update part pl part_group with frame a editing:

      if frame-field = "part" then do:
         /* FIND NEXT/PREVIOUS RECORD */
         {mfnp.i pt_mstr part pt_part part pt_part pt_part}
         if recno <> ? then do:
            part = pt_part.
            display part pt_desc1 with frame a.
         end.
      end.
      else if frame-field = "pl" then do:
         /* FIND NEXT/PREVIOUS RECORD */
         {mfnp.i pt_mstr pl pt_prod_line pl pt_prod_line pt_prod_part}
         if recno <> ? then do:
            display pt_prod_line @ pl with frame a.
         end.
         recno = ?.
      end.
      else if frame-field = "part_group" then do:
         /* FIND NEXT/PREVIOUS RECORD */
         {mfnp.i pt_mstr part_group pt_group part_group pt_group pt_group}
         if recno <> ? then do:
            display pt_group @ part_group with frame a.
         end.
         recno = ?.
      end.
      else do:
         status input.
         readkey.
         apply lastkey.
      end.
   end.

/*K1KW*/ {wbrp06.i &command = update &fields = "  part pl part_group"
          &frm = "a"}

/*K1KW*/ if (c-application-mode <> 'web') or
/*K1KW*/ (c-application-mode = 'web' and
/*K1KW*/ (c-web-request begins 'data')) then do:

   find pt_mstr where pt_part = part no-lock no-error.
   if available pt_mstr then display pt_desc1 with frame a.
   else display "" @ pt_desc1 with frame a.
   hide frame b.
   hide frame c.
   hide frame d.

/*K1KW*/ end.

   /* SELECT PRINTER */
   {mfselprt.i "terminal" 80}

   if part <> "" or (pl = "" and part_group = "" ) then do:
     for each pt_mstr where pt_part >= part
     and (pt_prod_line = pl or pl = "" )
     and (pt_group = part_group or part_group = "" )
     use-index pt_part
     no-lock with frame b width 120 no-attr-space:
         /* SET EXTERNAL LABELS */
         setFrameLabels(frame b:handle).
                
         /*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/
         if frame-line = frame-down and frame-down <> 0
         and pt_desc2 > "" then down 1 with frame b.

         display pt_part 
                 pt_desc1 
                 pt_um 
                 pt_prod_line /*column-label {&ppptiq_p_1}*/
                 pt_part_type 
                 pt_group     /*column-label {&ppptiq_p_2} */
                 pt_rev
                 pt_status
         WITH STREAM-IO /*GUI*/ .
         do with frame b:
            down 1.
            display pt_desc2 @ pt_desc1 WITH STREAM-IO /*GUI*/ .
         end.
     end.
   end.

   else if pl <> "" then do:
     for each pt_mstr where pt_prod_line = pl
     and (pt_group = part_group or part_group = "" )
     use-index pt_prod_part
     no-lock with frame c width 120 no-attr-space:
         /* SET EXTERNAL LABELS */
         setFrameLabels(frame c:handle).
                
         /*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/
         if frame-line = frame-down and frame-down <> 0
         and pt_desc2 > "" then down 1 with frame c.

         display pt_part 
                 pt_desc1 
                 pt_um 
                 pt_part_type 
                 pt_group 
                 pt_rev  
                 pt_status 
         WITH STREAM-IO /*GUI*/ .
/*          if pt_desc2 > "" then */
         do with frame c:
            down 1.
            display pt_desc2 @ pt_desc1 WITH STREAM-IO /*GUI*/ .
         end.
      end.
   end.
   
   else if part_group <> "" then do:
     for each pt_mstr where pt_group = part_group no-lock
     with frame d width 120 no-attr-space:
         /* SET EXTERNAL LABELS */
         setFrameLabels(frame d:handle).
                
         /*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/
         if frame-line = frame-down and frame-down <> 0
         and pt_desc2 > "" then down 1 with frame d.

         display pt_part 
                 pt_desc1 
                 pt_um 
                 pt_prod_line  
                 pt_part_type
                 pt_group
                 pt_rev 
                 pt_status 
         WITH STREAM-IO /*GUI*/ .
/*          if pt_desc2 > "" then */
         do with frame d:
            down 1.
            display pt_desc2 @ pt_desc1 WITH STREAM-IO /*GUI*/ .
         end.
     end.
   end.
   {mfreset.i}

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/
   {mfmsg.i 8 1}
end.

global_part = part.

/*K1KW*/ {wbrp04.i &frame-spec = a}
